package day05;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collection;

public class ForTest {

    @Test
    public void test1(){
        Collection coll = new ArrayList();
        coll.add(123);
        coll.add(789);
        coll.add(new String("tom"));
        coll.add(new Person("bob"));
        coll.add(false);

        for(Object obj : coll){
            System.out.println(obj);

        }


    }

    @Test
    public void test2(){
        int[] arr = new int[]{1,2,3,2,4234,5,43,8};
        for(int i : arr){
            System.out.println(i);

        }

    }


    @Test
    public void test3(){

        String[] arr = new String[] {"mm", "mm", "mm" };
//        for (int i = 0; i < arr.length; i++) {
//            arr[i] = "gg";
//        }

        for(String s: arr){
            s= "hh";

        }


        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

}
